/*
 Navicat Premium Data Transfer

 Source Server         : root
 Source Server Type    : MySQL
 Source Server Version : 80028
 Source Host           : localhost:3306
 Source Schema         : FAMS

 Target Server Type    : MySQL
 Target Server Version : 80028
 File Encoding         : 65001

 Date: 10/10/2022 14:34:45
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for finance
-- ----------------------------
DROP TABLE IF EXISTS `finance`;
CREATE TABLE `finance` (
  `f_id` int NOT NULL,
  `f_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `f_price` double DEFAULT NULL,
  `f_text` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `f_date` timestamp NULL DEFAULT NULL,
  `f_buyer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `id` int DEFAULT NULL,
  PRIMARY KEY (`f_id`) USING BTREE,
  KEY `fk_user_id2` (`id`) USING BTREE,
  CONSTRAINT `fk_user_id2` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of finance
-- ----------------------------
BEGIN;
INSERT INTO `finance` (`f_id`, `f_name`, `f_price`, `f_text`, `f_date`, `f_buyer`, `id`) VALUES (1, '12', 12, 'dadadaw', '2020-09-08 00:00:00', 'zzz', 1);
INSERT INTO `finance` (`f_id`, `f_name`, `f_price`, `f_text`, `f_date`, `f_buyer`, `id`) VALUES (2, '主机', 3999, '主机', '2020-09-08 00:00:00', NULL, NULL);
INSERT INTO `finance` (`f_id`, `f_name`, `f_price`, `f_text`, `f_date`, `f_buyer`, `id`) VALUES (3, '显示器', 2000, '显示器～', '2020-09-08 00:00:00', NULL, NULL);
INSERT INTO `finance` (`f_id`, `f_name`, `f_price`, `f_text`, `f_date`, `f_buyer`, `id`) VALUES (4, '桌子', 200, 'zhuozi', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for ratify
-- ----------------------------
DROP TABLE IF EXISTS `ratify`;
CREATE TABLE `ratify` (
  `r_id` int NOT NULL,
  `s_id` int DEFAULT NULL,
  `r_date` timestamp NULL DEFAULT NULL,
  `r_state` enum('yes','no') CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `r_text` text CHARACTER SET utf8 COLLATE utf8_general_ci,
  `f_id` int DEFAULT NULL,
  PRIMARY KEY (`r_id`) USING BTREE,
  KEY `fk_finance_f_id` (`f_id`) USING BTREE,
  KEY `fk_stock_s_id` (`s_id`) USING BTREE,
  CONSTRAINT `fk_finance_f_id` FOREIGN KEY (`f_id`) REFERENCES `finance` (`f_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_stock_s_id` FOREIGN KEY (`s_id`) REFERENCES `stock` (`s_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of ratify
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for stock
-- ----------------------------
DROP TABLE IF EXISTS `stock`;
CREATE TABLE `stock` (
  `s_id` int NOT NULL,
  `s_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `s_num` int DEFAULT NULL,
  `s_price` double DEFAULT NULL,
  `s_text` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `s_date` timestamp NULL DEFAULT NULL,
  `s_brand` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `s_buyer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `id` int DEFAULT NULL,
  PRIMARY KEY (`s_id`) USING BTREE,
  KEY `fk_user_id` (`id`) USING BTREE,
  CONSTRAINT `fk_user_id` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of stock
-- ----------------------------
BEGIN;
INSERT INTO `stock` (`s_id`, `s_name`, `s_num`, `s_price`, `s_text`, `s_date`, `s_brand`, `s_buyer`, `id`) VALUES (3, '椅子', 21, 1, 'dcasdc', '2020-09-08 00:00:00', '无', 'ss', 1);
INSERT INTO `stock` (`s_id`, `s_name`, `s_num`, `s_price`, `s_text`, `s_date`, `s_brand`, `s_buyer`, `id`) VALUES (4, '桌子', 13, 100, '13张桌子', '2022-09-08 00:00:00', '无', NULL, 2);
INSERT INTO `stock` (`s_id`, `s_name`, `s_num`, `s_price`, `s_text`, `s_date`, `s_brand`, `s_buyer`, `id`) VALUES (5, '显示器', 30, 2000, '这是显示器', '2022-09-08 00:00:00', 'dell', NULL, NULL);
INSERT INTO `stock` (`s_id`, `s_name`, `s_num`, `s_price`, `s_text`, `s_date`, `s_brand`, `s_buyer`, `id`) VALUES (6, '主机', 30, 3999, '主机～', '2022-09-08 00:00:00', 'dell', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `age` int DEFAULT NULL,
  `level` int DEFAULT NULL,
  `mail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `pwd` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `no` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (1, '汪靖蒙', 18, 1, '1@1.com', 'Qwe123.', '159278777', '1');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (2, '方晨凯', 20, 1, '2@2.com', 'Qwe123.', '1592787771', '2');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (3, '吴逸鑫', 18, 1, '3@3.com', 'Qwe123.', '1592787771', '3');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (6, '李泽祯', 18, 1, '4@4.com', 'Qwe123.', '159278777', '4');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (7, '潘正', 11, 2, '5@5.com', 'Qwe123.', '159278777', '5');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (8, 'panzheng1', 11, 1, '11@12.com', 'Qwe123.', '15923537690', '11');
INSERT INTO `user` (`id`, `name`, `age`, `level`, `mail`, `pwd`, `phone`, `no`) VALUES (10, '呜呜呜呜', 18, 3, '1@33.com', 'Qwe123.', '15923537697', '18');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
